package com.example.demo1234.exception;

import org.apache.shiro.authc.UnknownAccountException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class MyExceptionController {


    Logger logger= LoggerFactory.getLogger(MyExceptionController.class);

    @ExceptionHandler(Exception.class)
    public String show(Exception e)
    {
        logger.error("MyExceptionController发生");
        System.out.println("error");
        return "error";
    }

    @ExceptionHandler(UnknownAccountException.class)
    public String show1(UnknownAccountException  e)
    {
        logger.error("meiyouyonghuming");
        return  "false";
    }
}
